3.18 \(\int \frac{\sec ^4(x)}{a+b \cot (x)} \, dx\)

Optimal. Leaf size=73 \[ \frac{\left (a^2+b^2\right ) \tan (x)}{a^3}-\frac{b \left (a^2+b^2\right ) \log (\tan (x))}{a^4}-\frac{b \left (a^2+b^2\right ) \log (a+b \cot (x))}{a^4}-\frac{b \tan ^2(x)}{2 a^2}+\frac{\tan ^3(x)}{3 a} \]

[Out]

-((b*(a^2 + b^2)*Log[a + b*Cot[x]])/a^4) - (b*(a^2 + b^2)*Log[Tan[x]])/a^4 + ((a^2 + b^2)*Tan[x])/a^3 - (b*Tan
[x]^2)/(2*a^2) + Tan[x]^3/(3*a)

________________________________________________________________________________________

Rubi [A]  time = 0.0980419, antiderivative size = 73, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3516, 894} \[ \frac{\left (a^2+b^2\right ) \tan (x)}{a^3}-\frac{b \left (a^2+b^2\right ) \log (\tan (x))}{a^4}-\frac{b \left (a^2+b^2\right ) \log (a+b \cot (x))}{a^4}-\frac{b \tan ^2(x)}{2 a^2}+\frac{\tan ^3(x)}{3 a} \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]^4/(a + b*Cot[x]),x]

[Out]

-((b*(a^2 + b^2)*Log[a + b*Cot[x]])/a^4) - (b*(a^2 + b^2)*Log[Tan[x]])/a^4 + ((a^2 + b^2)*Tan[x])/a^3 - (b*Tan
[x]^2)/(2*a^2) + Tan[x]^3/(3*a)

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rubi steps

\begin{align*} \int \frac{\sec ^4(x)}{a+b \cot (x)} \, dx &=-\left (b \operatorname{Subst}\left (\int \frac{b^2+x^2}{x^4 (a+x)} \, dx,x,b \cot (x)\right )\right )\\ &=-\left (b \operatorname{Subst}\left (\int \left (\frac{b^2}{a x^4}-\frac{b^2}{a^2 x^3}+\frac{a^2+b^2}{a^3 x^2}+\frac{-a^2-b^2}{a^4 x}+\frac{a^2+b^2}{a^4 (a+x)}\right ) \, dx,x,b \cot (x)\right )\right )\\ &=-\frac{b \left (a^2+b^2\right ) \log (a+b \cot (x))}{a^4}-\frac{b \left (a^2+b^2\right ) \log (\tan (x))}{a^4}+\frac{\left (a^2+b^2\right ) \tan (x)}{a^3}-\frac{b \tan ^2(x)}{2 a^2}+\frac{\tan ^3(x)}{3 a}\\ \end{align*}

Mathematica [A]  time = 0.267152, size = 66, normalized size = 0.9 \[ \frac{\left (4 a^3+6 a b^2\right ) \tan (x)+6 b \left (a^2+b^2\right ) (\log (\cos (x))-\log (a \sin (x)+b \cos (x)))+a^2 \sec ^2(x) (2 a \tan (x)-3 b)}{6 a^4} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^4/(a + b*Cot[x]),x]

[Out]

(6*b*(a^2 + b^2)*(Log[Cos[x]] - Log[b*Cos[x] + a*Sin[x]]) + (4*a^3 + 6*a*b^2)*Tan[x] + a^2*Sec[x]^2*(-3*b + 2*
a*Tan[x]))/(6*a^4)

________________________________________________________________________________________

Maple [A]  time = 0.043, size = 64, normalized size = 0.9 \begin{align*}{\frac{ \left ( \tan \left ( x \right ) \right ) ^{3}}{3\,a}}-{\frac{b \left ( \tan \left ( x \right ) \right ) ^{2}}{2\,{a}^{2}}}+{\frac{\tan \left ( x \right ) }{a}}+{\frac{{b}^{2}\tan \left ( x \right ) }{{a}^{3}}}-{\frac{b\ln \left ( a\tan \left ( x \right ) +b \right ) }{{a}^{2}}}-{\frac{{b}^{3}\ln \left ( a\tan \left ( x \right ) +b \right ) }{{a}^{4}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^4/(a+b*cot(x)),x)

[Out]

1/3*tan(x)^3/a-1/2*b*tan(x)^2/a^2+tan(x)/a+1/a^3*b^2*tan(x)-b/a^2*ln(a*tan(x)+b)-b^3/a^4*ln(a*tan(x)+b)

________________________________________________________________________________________

Maxima [A]  time = 1.28219, size = 76, normalized size = 1.04 \begin{align*} \frac{2 \, a^{2} \tan \left (x\right )^{3} - 3 \, a b \tan \left (x\right )^{2} + 6 \,{\left (a^{2} + b^{2}\right )} \tan \left (x\right )}{6 \, a^{3}} - \frac{{\left (a^{2} b + b^{3}\right )} \log \left (a \tan \left (x\right ) + b\right )}{a^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^4/(a+b*cot(x)),x, algorithm="maxima")

[Out]

1/6*(2*a^2*tan(x)^3 - 3*a*b*tan(x)^2 + 6*(a^2 + b^2)*tan(x))/a^3 - (a^2*b + b^3)*log(a*tan(x) + b)/a^4

________________________________________________________________________________________

Fricas [A]  time = 2.17184, size = 278, normalized size = 3.81 \begin{align*} -\frac{3 \,{\left (a^{2} b + b^{3}\right )} \cos \left (x\right )^{3} \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) -{\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}\right ) - 3 \,{\left (a^{2} b + b^{3}\right )} \cos \left (x\right )^{3} \log \left (\cos \left (x\right )^{2}\right ) + 3 \, a^{2} b \cos \left (x\right ) - 2 \,{\left (a^{3} +{\left (2 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{6 \, a^{4} \cos \left (x\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^4/(a+b*cot(x)),x, algorithm="fricas")

[Out]

-1/6*(3*(a^2*b + b^3)*cos(x)^3*log(2*a*b*cos(x)*sin(x) - (a^2 - b^2)*cos(x)^2 + a^2) - 3*(a^2*b + b^3)*cos(x)^
3*log(cos(x)^2) + 3*a^2*b*cos(x) - 2*(a^3 + (2*a^3 + 3*a*b^2)*cos(x)^2)*sin(x))/(a^4*cos(x)^3)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec ^{4}{\left (x \right )}}{a + b \cot{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**4/(a+b*cot(x)),x)

[Out]

Integral(sec(x)**4/(a + b*cot(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.2557, size = 81, normalized size = 1.11 \begin{align*} \frac{2 \, a^{2} \tan \left (x\right )^{3} - 3 \, a b \tan \left (x\right )^{2} + 6 \, a^{2} \tan \left (x\right ) + 6 \, b^{2} \tan \left (x\right )}{6 \, a^{3}} - \frac{{\left (a^{2} b + b^{3}\right )} \log \left ({\left | a \tan \left (x\right ) + b \right |}\right )}{a^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^4/(a+b*cot(x)),x, algorithm="giac")

[Out]

1/6*(2*a^2*tan(x)^3 - 3*a*b*tan(x)^2 + 6*a^2*tan(x) + 6*b^2*tan(x))/a^3 - (a^2*b + b^3)*log(abs(a*tan(x) + b))
/a^4